#Goal for this example:

#build a static library that sets cuda only compile flags and
#-Xcompiler flags to be propagated to the host compiler.

#specify a consuming cxx library. The consuming library should be forwarded
#what?

#
set(CMAKE_CUDA_FLAGS "--generate-code arch=compute_30,code=sm_30 -Xcompiler=-Wall")
set(debug_compile_flags --generate-code arch=compute_20,code=sm_20 -Xcompiler=-Werror)

add_library(compile_flags static.cu)

target_compile_options(compile_flags
  PRIVATE
    -maxrregcount=32
  )
target_compile_options(compile_flags
  PRIVATE
    $<$<CONFIG:DEBUG>:$<BUILD_INTERFACE:${debug_compile_flags}>>
  )

target_compile_definitions(compile_flags
  PUBLIC
  "PACKED_DEFINE=__attribute__((packed))"
  )
add_definitions(-DFOO="BAR \(BAZ\)")

add_executable(compile_flags_exec main.cpp)
target_link_libraries(compile_flags_exec PRIVATE compile_flags)
